package com.orhon.smartcampus.modules.teacher.mm;

import java.util.List;

import org.mapstruct.InheritConfiguration;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

import com.orhon.smartcampus.modules.base.mm.DictionaryMapper;
import com.orhon.smartcampus.modules.base.mm.LangMapper;
import com.orhon.smartcampus.modules.teacher.entity.LearningExperience;
import com.orhon.smartcampus.modules.teacher.gqlModel.GQLLearningExperience;

@Mapper(
        uses={
                LangMapper.class,
                DictionaryMapper.class
        }
)
public interface LearningExperienceMapper {

    LearningExperienceMapper MAPPER = Mappers.getMapper(LearningExperienceMapper.class);
    @Mappings({
            @Mapping(source="id",target="id"),
            @Mapping(source="teacher_id",target="teacher_id"),
            @Mapping(source="school_id",target="school_id"),
            @Mapping(source="learnlevel",target="learnlevel", qualifiedByName = "str2dic"),
            @Mapping(source="startdate",target="startdate"),
            @Mapping(source="enddate",target="enddate"),
            @Mapping(source="way",target="way", qualifiedByName = "str2dic"),
            @Mapping(source="degree",target="degree", qualifiedByName = "str2dic"),
            @Mapping(source="image",target="image"),
            @Mapping(source="shenhe",target="shenhe"),
            @Mapping(source="type",target="type"),
            @Mapping(source="academy",target="academy"),
            @Mapping(source="profession",target="profession"),
            @Mapping(source="workstationname",target="workstationname"),
            @Mapping(source="researche",target="researche"),
            @Mapping(source="duration",target="duration"),
            @Mapping(source="createdBy",target="created_by"),
            @Mapping(source="updatedBy",target="updated_by"),
            @Mapping(source="createdAt",target="created_at"),
            @Mapping(source="updatedAt",target="updated_at"),
            @Mapping(source="deletedAt",target="deleted_at"),
    })
    GQLLearningExperience mapEntity(LearningExperience entity);
    @InheritConfiguration(name = "mapEntity")
    List<GQLLearningExperience> mapEntityList(List<LearningExperience> entities);
}
